﻿using System.ComponentModel;
using SAPPDI.Entitys;
using TestImpresion.Annotations;
using TestImpresion.Clases.Listas;

namespace TestImpresion.Clases
{
    public class InterioresFormulario : INotifyPropertyChanged
    {
        private Interiores _currentInteriores;
        public Interiores CurrentInteriores
        {
            get
            {
                return _currentInteriores;
            }
            set
            {
                _currentInteriores = value;
                NotifyPropertyChanged("CurrentInteriores");
            }
        }

        private ComparPorFormulario _comprarInterioesFormulario;
        public ComparPorFormulario ComprarInterioesFormulario
        {
            get
            {
                return _comprarInterioesFormulario;
            }
            set
            {
                _comprarInterioesFormulario = value;
                NotifyPropertyChanged("ComprarInterioesFormulario");
            }
        }

        private FormularioBase _parent;
        public FormularioBase Parent
        {
            get { return this._parent; }
            set
            {
                this._parent = value;
                NotifyPropertyChanged("Parent");
            }
        }

        public InterioresFormulario()
        {
            this.CurrentInteriores = new Interiores { TipoPapels = new DatosCombos().ObtenTiposPapel() };
            this._comprarInterioesFormulario = new ComparPorFormulario();
        }

        public event PropertyChangedEventHandler PropertyChanged;

        [NotifyPropertyChangedInvocator]
        protected virtual void NotifyPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
